using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Windows.Forms;
using C1.Win.C1Input;
using C1.Win.C1TrueDBGrid;
using PCSComProduction.WorkOrder.BO;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.PCSExc;
using PCSUtils.Framework.ReportFrame;
using PCSUtils.Log;
using PCSUtils.Utils;
using CancelEventArgs = System.ComponentModel.CancelEventArgs;
using PCSComUtils.DataContext;

namespace PCSProduction.WorkOrder
{
    /// <summary>
    /// Summary description for SelectWorkOrders.
    /// </summary>
    public class RequiredMaterial : Form
    {
        private C1TrueDBGrid dgrdData;
        private Button btnClose;
        private Button btnHelp;
        private Button btnSearch;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private Container components = null;
        private const string THIS = "PCSProduction.WorkOrder.RequiredMaterial";
        private EnumAction mFormMode = EnumAction.Default;
        private DataTable dtStoreGridLayout;
        private DataSet dstGridData = new DataSet();
        private PRO_RequiredMaterialMaster voRequireMaterialMaster = new PRO_RequiredMaterialMaster();
        private RequiredMaterialBO boRequired = new RequiredMaterialBO();
        //define some constant column
        private const string BOM_ITEM = "Bom_Item";
        private const string SLDUTRU = "SLdutru";
        private const string WOQTY = "WO_Qty";
        const string v_PRODUCTINFOMATION = "v_ITMSaleOderDetailWithProduct";

        #region Properties

        private C1DateEdit dtmPostDate;
        private Label lblPostDate;
        private Label lblTransNo;
        private TextBox txtPartName;
        private Label lblPartName;
        private TextBox txtPurpose;
        private Button btnPurpose;
        private Label lblPurpose;
        private Button btnPrint;
        private Button btnSave;
        private Button btnAdd;
        private TextBox txtProductionLine;
        private Label lblProductionLine;
        private Button btnProductionLine;
        private Button btnEdit;
        private Button btnDelete;
        private TextBox txtTransNo;
        private TextBox txtFGoodsCode;
        private Button btnFGoodsCode;
        private Label lblFGoodsCode;
        private CheckBox chkProduction;
        private System.Windows.Forms.Button btnConfirm;
        private Button btnTransNo;

        #endregion Properties

        public RequiredMaterial()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(RequiredMaterial));
            this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.btnClose = new System.Windows.Forms.Button();
            this.btnHelp = new System.Windows.Forms.Button();
            this.btnSearch = new System.Windows.Forms.Button();
            this.txtTransNo = new System.Windows.Forms.TextBox();
            this.dtmPostDate = new C1.Win.C1Input.C1DateEdit();
            this.lblPostDate = new System.Windows.Forms.Label();
            this.lblTransNo = new System.Windows.Forms.Label();
            this.btnTransNo = new System.Windows.Forms.Button();
            this.txtFGoodsCode = new System.Windows.Forms.TextBox();
            this.btnFGoodsCode = new System.Windows.Forms.Button();
            this.lblFGoodsCode = new System.Windows.Forms.Label();
            this.txtPartName = new System.Windows.Forms.TextBox();
            this.lblPartName = new System.Windows.Forms.Label();
            this.txtPurpose = new System.Windows.Forms.TextBox();
            this.btnPurpose = new System.Windows.Forms.Button();
            this.lblPurpose = new System.Windows.Forms.Label();
            this.btnPrint = new System.Windows.Forms.Button();
            this.btnSave = new System.Windows.Forms.Button();
            this.btnAdd = new System.Windows.Forms.Button();
            this.btnEdit = new System.Windows.Forms.Button();
            this.btnDelete = new System.Windows.Forms.Button();
            this.txtProductionLine = new System.Windows.Forms.TextBox();
            this.lblProductionLine = new System.Windows.Forms.Label();
            this.btnProductionLine = new System.Windows.Forms.Button();
            this.chkProduction = new System.Windows.Forms.CheckBox();
            this.btnConfirm = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmPostDate)).BeginInit();
            this.SuspendLayout();
            // 
            // dgrdData
            // 
            this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
            this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
            this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
            this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
            this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
            this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
            this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
            this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
            this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
            this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
            this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
            this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
            this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
            this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
            this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
            this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
            this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
            this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
            this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
            this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
            this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
            this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
            this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
            this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
            this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
            this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
            this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
            this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
            this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
            this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
            this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
            this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
            this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
            this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
            this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
            this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
            this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
            this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
            this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
            this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
            this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
            this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
            this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
            this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
            this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
            this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.dgrdData.Name = "dgrdData";
            this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
            this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
            this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
            this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
            this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
            this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
            this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
            this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
            this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
            this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
            this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
            this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
            this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
            this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
            this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
            this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
            this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
            this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
            this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
            this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
            this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
            this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
            this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
            this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
            this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
            this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
            this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
            this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
            this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
            this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
            this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
            this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
            this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
            this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
            this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
            this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
            this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
            this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
            this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
            this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
            this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
            this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
            this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
            this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
            this.dgrdData.Text = resources.GetString("dgrdData.Text");
            this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
            this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
            this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
            this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
            this.dgrdData.AfterColUpdate += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColUpdate);
            this.dgrdData.BeforeColUpdate += new C1.Win.C1TrueDBGrid.BeforeColUpdateEventHandler(this.dgrdData_BeforeColUpdate);
            this.dgrdData.BeforeDelete += new C1.Win.C1TrueDBGrid.CancelEventHandler(this.dgrdData_BeforeDelete);
            this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
            this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
            // 
            // btnClose
            // 
            this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
            this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
            this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
            this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
            this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
            this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
            this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
            this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
            this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
            this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
            this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
            this.btnClose.Name = "btnClose";
            this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
            this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
            this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
            this.btnClose.Text = resources.GetString("btnClose.Text");
            this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
            this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            // 
            // btnHelp
            // 
            this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
            this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
            this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
            this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
            this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
            this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
            this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
            this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
            this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
            this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
            this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
            this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
            this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
            this.btnHelp.Name = "btnHelp";
            this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
            this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
            this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
            this.btnHelp.Text = resources.GetString("btnHelp.Text");
            this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
            this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
            // 
            // btnSearch
            // 
            this.btnSearch.AccessibleDescription = resources.GetString("btnSearch.AccessibleDescription");
            this.btnSearch.AccessibleName = resources.GetString("btnSearch.AccessibleName");
            this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearch.Anchor")));
            this.btnSearch.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearch.BackgroundImage")));
            this.btnSearch.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearch.Dock")));
            this.btnSearch.Enabled = ((bool)(resources.GetObject("btnSearch.Enabled")));
            this.btnSearch.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearch.FlatStyle")));
            this.btnSearch.Font = ((System.Drawing.Font)(resources.GetObject("btnSearch.Font")));
            this.btnSearch.Image = ((System.Drawing.Image)(resources.GetObject("btnSearch.Image")));
            this.btnSearch.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearch.ImageAlign")));
            this.btnSearch.ImageIndex = ((int)(resources.GetObject("btnSearch.ImageIndex")));
            this.btnSearch.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearch.ImeMode")));
            this.btnSearch.Location = ((System.Drawing.Point)(resources.GetObject("btnSearch.Location")));
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearch.RightToLeft")));
            this.btnSearch.Size = ((System.Drawing.Size)(resources.GetObject("btnSearch.Size")));
            this.btnSearch.TabIndex = ((int)(resources.GetObject("btnSearch.TabIndex")));
            this.btnSearch.Text = resources.GetString("btnSearch.Text");
            this.btnSearch.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearch.TextAlign")));
            this.btnSearch.Visible = ((bool)(resources.GetObject("btnSearch.Visible")));
            this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
            // 
            // txtTransNo
            // 
            this.txtTransNo.AccessibleDescription = resources.GetString("txtTransNo.AccessibleDescription");
            this.txtTransNo.AccessibleName = resources.GetString("txtTransNo.AccessibleName");
            this.txtTransNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtTransNo.Anchor")));
            this.txtTransNo.AutoSize = ((bool)(resources.GetObject("txtTransNo.AutoSize")));
            this.txtTransNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtTransNo.BackgroundImage")));
            this.txtTransNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtTransNo.Dock")));
            this.txtTransNo.Enabled = ((bool)(resources.GetObject("txtTransNo.Enabled")));
            this.txtTransNo.Font = ((System.Drawing.Font)(resources.GetObject("txtTransNo.Font")));
            this.txtTransNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtTransNo.ImeMode")));
            this.txtTransNo.Location = ((System.Drawing.Point)(resources.GetObject("txtTransNo.Location")));
            this.txtTransNo.MaxLength = ((int)(resources.GetObject("txtTransNo.MaxLength")));
            this.txtTransNo.Multiline = ((bool)(resources.GetObject("txtTransNo.Multiline")));
            this.txtTransNo.Name = "txtTransNo";
            this.txtTransNo.PasswordChar = ((char)(resources.GetObject("txtTransNo.PasswordChar")));
            this.txtTransNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtTransNo.RightToLeft")));
            this.txtTransNo.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtTransNo.ScrollBars")));
            this.txtTransNo.Size = ((System.Drawing.Size)(resources.GetObject("txtTransNo.Size")));
            this.txtTransNo.TabIndex = ((int)(resources.GetObject("txtTransNo.TabIndex")));
            this.txtTransNo.Text = resources.GetString("txtTransNo.Text");
            this.txtTransNo.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtTransNo.TextAlign")));
            this.txtTransNo.Visible = ((bool)(resources.GetObject("txtTransNo.Visible")));
            this.txtTransNo.WordWrap = ((bool)(resources.GetObject("txtTransNo.WordWrap")));
            this.txtTransNo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtTransNo_KeyDown);
            this.txtTransNo.Validating += new System.ComponentModel.CancelEventHandler(this.txtTransNo_Validating);
            // 
            // dtmPostDate
            // 
            this.dtmPostDate.AcceptsEscape = ((bool)(resources.GetObject("dtmPostDate.AcceptsEscape")));
            this.dtmPostDate.AccessibleDescription = resources.GetString("dtmPostDate.AccessibleDescription");
            this.dtmPostDate.AccessibleName = resources.GetString("dtmPostDate.AccessibleName");
            this.dtmPostDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dtmPostDate.Anchor")));
            this.dtmPostDate.AutoSize = ((bool)(resources.GetObject("dtmPostDate.AutoSize")));
            this.dtmPostDate.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmPostDate.BackgroundImage")));
            this.dtmPostDate.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dtmPostDate.BorderStyle")));
            // 
            // dtmPostDate.Calendar
            // 
            this.dtmPostDate.Calendar.AccessibleDescription = resources.GetString("dtmPostDate.Calendar.AccessibleDescription");
            this.dtmPostDate.Calendar.AccessibleName = resources.GetString("dtmPostDate.Calendar.AccessibleName");
            this.dtmPostDate.Calendar.AnnuallyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.AnnuallyBoldedDates")));
            this.dtmPostDate.Calendar.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmPostDate.Calendar.BackgroundImage")));
            this.dtmPostDate.Calendar.BoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.BoldedDates")));
            this.dtmPostDate.Calendar.CalendarDimensions = ((System.Drawing.Size)(resources.GetObject("dtmPostDate.Calendar.CalendarDimensions")));
            this.dtmPostDate.Calendar.Enabled = ((bool)(resources.GetObject("dtmPostDate.Calendar.Enabled")));
            this.dtmPostDate.Calendar.FirstDayOfWeek = ((System.Windows.Forms.Day)(resources.GetObject("dtmPostDate.Calendar.FirstDayOfWeek")));
            this.dtmPostDate.Calendar.Font = ((System.Drawing.Font)(resources.GetObject("dtmPostDate.Calendar.Font")));
            this.dtmPostDate.Calendar.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmPostDate.Calendar.ImeMode")));
            this.dtmPostDate.Calendar.MonthlyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.MonthlyBoldedDates")));
            this.dtmPostDate.Calendar.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmPostDate.Calendar.RightToLeft")));
            this.dtmPostDate.Calendar.ShowClearButton = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowClearButton")));
            this.dtmPostDate.Calendar.ShowTodayButton = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowTodayButton")));
            this.dtmPostDate.Calendar.ShowWeekNumbers = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowWeekNumbers")));
            this.dtmPostDate.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.CaseSensitive")));
            this.dtmPostDate.Culture = ((int)(resources.GetObject("dtmPostDate.Culture")));
            this.dtmPostDate.CurrentTimeZone = ((bool)(resources.GetObject("dtmPostDate.CurrentTimeZone")));
            this.dtmPostDate.CustomFormat = resources.GetString("dtmPostDate.CustomFormat");
            this.dtmPostDate.DaylightTimeAdjustment = ((C1.Win.C1Input.DaylightTimeAdjustmentEnum)(resources.GetObject("dtmPostDate.DaylightTimeAdjustment")));
            this.dtmPostDate.DisplayFormat.CustomFormat = resources.GetString("dtmPostDate.DisplayFormat.CustomFormat");
            this.dtmPostDate.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.DisplayFormat.FormatType")));
            this.dtmPostDate.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmPostDate.DisplayFormat.Inherit")));
            this.dtmPostDate.DisplayFormat.NullText = resources.GetString("dtmPostDate.DisplayFormat.NullText");
            this.dtmPostDate.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.DisplayFormat.TrimEnd")));
            this.dtmPostDate.DisplayFormat.TrimStart = ((bool)(resources.GetObject("dtmPostDate.DisplayFormat.TrimStart")));
            this.dtmPostDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dtmPostDate.Dock")));
            this.dtmPostDate.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("dtmPostDate.DropDownFormAlign")));
            this.dtmPostDate.EditFormat.CustomFormat = resources.GetString("dtmPostDate.EditFormat.CustomFormat");
            this.dtmPostDate.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.EditFormat.FormatType")));
            this.dtmPostDate.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmPostDate.EditFormat.Inherit")));
            this.dtmPostDate.EditFormat.NullText = resources.GetString("dtmPostDate.EditFormat.NullText");
            this.dtmPostDate.EditFormat.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.EditFormat.TrimEnd")));
            this.dtmPostDate.EditFormat.TrimStart = ((bool)(resources.GetObject("dtmPostDate.EditFormat.TrimStart")));
            this.dtmPostDate.EditMask = resources.GetString("dtmPostDate.EditMask");
            this.dtmPostDate.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.EmptyAsNull")));
            this.dtmPostDate.Enabled = ((bool)(resources.GetObject("dtmPostDate.Enabled")));
            this.dtmPostDate.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("dtmPostDate.ErrorInfo.BeepOnError")));
            this.dtmPostDate.ErrorInfo.ErrorMessage = resources.GetString("dtmPostDate.ErrorInfo.ErrorMessage");
            this.dtmPostDate.ErrorInfo.ErrorMessageCaption = resources.GetString("dtmPostDate.ErrorInfo.ErrorMessageCaption");
            this.dtmPostDate.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("dtmPostDate.ErrorInfo.ShowErrorMessage")));
            this.dtmPostDate.ErrorInfo.ValueOnError = ((object)(resources.GetObject("dtmPostDate.ErrorInfo.ValueOnError")));
            this.dtmPostDate.Font = ((System.Drawing.Font)(resources.GetObject("dtmPostDate.Font")));
            this.dtmPostDate.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.FormatType")));
            this.dtmPostDate.GapHeight = ((int)(resources.GetObject("dtmPostDate.GapHeight")));
            this.dtmPostDate.GMTOffset = ((System.TimeSpan)(resources.GetObject("dtmPostDate.GMTOffset")));
            this.dtmPostDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmPostDate.ImeMode")));
            this.dtmPostDate.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("dtmPostDate.InitialSelection")));
            this.dtmPostDate.Location = ((System.Drawing.Point)(resources.GetObject("dtmPostDate.Location")));
            this.dtmPostDate.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.AutoTabWhenFilled")));
            this.dtmPostDate.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.CaseSensitive")));
            this.dtmPostDate.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.CopyWithLiterals")));
            this.dtmPostDate.MaskInfo.EditMask = resources.GetString("dtmPostDate.MaskInfo.EditMask");
            this.dtmPostDate.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.EmptyAsNull")));
            this.dtmPostDate.MaskInfo.ErrorMessage = resources.GetString("dtmPostDate.MaskInfo.ErrorMessage");
            this.dtmPostDate.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("dtmPostDate.MaskInfo.Inherit")));
            this.dtmPostDate.MaskInfo.PromptChar = ((char)(resources.GetObject("dtmPostDate.MaskInfo.PromptChar")));
            this.dtmPostDate.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("dtmPostDate.MaskInfo.ShowLiterals")));
            this.dtmPostDate.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("dtmPostDate.MaskInfo.StoredEmptyChar")));
            this.dtmPostDate.MaxLength = ((int)(resources.GetObject("dtmPostDate.MaxLength")));
            this.dtmPostDate.Name = "dtmPostDate";
            this.dtmPostDate.NullText = resources.GetString("dtmPostDate.NullText");
            this.dtmPostDate.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.CaseSensitive")));
            this.dtmPostDate.ParseInfo.CustomFormat = resources.GetString("dtmPostDate.ParseInfo.CustomFormat");
            this.dtmPostDate.ParseInfo.DateTimeStyle = ((C1.Win.C1Input.DateTimeStyleFlags)(resources.GetObject("dtmPostDate.ParseInfo.DateTimeStyle")));
            this.dtmPostDate.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.EmptyAsNull")));
            this.dtmPostDate.ParseInfo.ErrorMessage = resources.GetString("dtmPostDate.ParseInfo.ErrorMessage");
            this.dtmPostDate.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.ParseInfo.FormatType")));
            this.dtmPostDate.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("dtmPostDate.ParseInfo.Inherit")));
            this.dtmPostDate.ParseInfo.NullText = resources.GetString("dtmPostDate.ParseInfo.NullText");
            this.dtmPostDate.ParseInfo.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.TrimEnd")));
            this.dtmPostDate.ParseInfo.TrimStart = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.TrimStart")));
            this.dtmPostDate.PasswordChar = ((char)(resources.GetObject("dtmPostDate.PasswordChar")));
            this.dtmPostDate.PostValidation.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.PostValidation.CaseSensitive")));
            this.dtmPostDate.PostValidation.ErrorMessage = resources.GetString("dtmPostDate.PostValidation.ErrorMessage");
            this.dtmPostDate.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("dtmPostDate.PostValidation.Inherit")));
            this.dtmPostDate.PostValidation.Intervals.AddRange(new C1.Win.C1Input.ValueInterval[] {
																									  ((C1.Win.C1Input.ValueInterval)(resources.GetObject("dtmPostDate.PostValidation.Intervals")))});
            this.dtmPostDate.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("dtmPostDate.PostValidation.Validation")));
            this.dtmPostDate.PostValidation.Values = ((System.Array)(resources.GetObject("dtmPostDate.PostValidation.Values")));
            this.dtmPostDate.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("dtmPostDate.PostValidation.ValuesExcluded")));
            this.dtmPostDate.PreValidation.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.PreValidation.CaseSensitive")));
            this.dtmPostDate.PreValidation.ErrorMessage = resources.GetString("dtmPostDate.PreValidation.ErrorMessage");
            this.dtmPostDate.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("dtmPostDate.PreValidation.Inherit")));
            this.dtmPostDate.PreValidation.ItemSeparator = resources.GetString("dtmPostDate.PreValidation.ItemSeparator");
            this.dtmPostDate.PreValidation.PatternString = resources.GetString("dtmPostDate.PreValidation.PatternString");
            this.dtmPostDate.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("dtmPostDate.PreValidation.RegexOptions")));
            this.dtmPostDate.PreValidation.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.PreValidation.TrimEnd")));
            this.dtmPostDate.PreValidation.TrimStart = ((bool)(resources.GetObject("dtmPostDate.PreValidation.TrimStart")));
            this.dtmPostDate.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("dtmPostDate.PreValidation.Validation")));
            this.dtmPostDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmPostDate.RightToLeft")));
            this.dtmPostDate.ShowFocusRectangle = ((bool)(resources.GetObject("dtmPostDate.ShowFocusRectangle")));
            this.dtmPostDate.Size = ((System.Drawing.Size)(resources.GetObject("dtmPostDate.Size")));
            this.dtmPostDate.TabIndex = ((int)(resources.GetObject("dtmPostDate.TabIndex")));
            this.dtmPostDate.Tag = ((object)(resources.GetObject("dtmPostDate.Tag")));
            this.dtmPostDate.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("dtmPostDate.TextAlign")));
            this.dtmPostDate.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.TrimEnd")));
            this.dtmPostDate.TrimStart = ((bool)(resources.GetObject("dtmPostDate.TrimStart")));
            this.dtmPostDate.UserCultureOverride = ((bool)(resources.GetObject("dtmPostDate.UserCultureOverride")));
            this.dtmPostDate.Value = ((object)(resources.GetObject("dtmPostDate.Value")));
            this.dtmPostDate.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("dtmPostDate.VerticalAlign")));
            this.dtmPostDate.Visible = ((bool)(resources.GetObject("dtmPostDate.Visible")));
            this.dtmPostDate.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("dtmPostDate.VisibleButtons")));
            // 
            // lblPostDate
            // 
            this.lblPostDate.AccessibleDescription = resources.GetString("lblPostDate.AccessibleDescription");
            this.lblPostDate.AccessibleName = resources.GetString("lblPostDate.AccessibleName");
            this.lblPostDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPostDate.Anchor")));
            this.lblPostDate.AutoSize = ((bool)(resources.GetObject("lblPostDate.AutoSize")));
            this.lblPostDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPostDate.Dock")));
            this.lblPostDate.Enabled = ((bool)(resources.GetObject("lblPostDate.Enabled")));
            this.lblPostDate.Font = ((System.Drawing.Font)(resources.GetObject("lblPostDate.Font")));
            this.lblPostDate.ForeColor = System.Drawing.Color.Maroon;
            this.lblPostDate.Image = ((System.Drawing.Image)(resources.GetObject("lblPostDate.Image")));
            this.lblPostDate.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPostDate.ImageAlign")));
            this.lblPostDate.ImageIndex = ((int)(resources.GetObject("lblPostDate.ImageIndex")));
            this.lblPostDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPostDate.ImeMode")));
            this.lblPostDate.Location = ((System.Drawing.Point)(resources.GetObject("lblPostDate.Location")));
            this.lblPostDate.Name = "lblPostDate";
            this.lblPostDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPostDate.RightToLeft")));
            this.lblPostDate.Size = ((System.Drawing.Size)(resources.GetObject("lblPostDate.Size")));
            this.lblPostDate.TabIndex = ((int)(resources.GetObject("lblPostDate.TabIndex")));
            this.lblPostDate.Text = resources.GetString("lblPostDate.Text");
            this.lblPostDate.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPostDate.TextAlign")));
            this.lblPostDate.Visible = ((bool)(resources.GetObject("lblPostDate.Visible")));
            // 
            // lblTransNo
            // 
            this.lblTransNo.AccessibleDescription = resources.GetString("lblTransNo.AccessibleDescription");
            this.lblTransNo.AccessibleName = resources.GetString("lblTransNo.AccessibleName");
            this.lblTransNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblTransNo.Anchor")));
            this.lblTransNo.AutoSize = ((bool)(resources.GetObject("lblTransNo.AutoSize")));
            this.lblTransNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblTransNo.Dock")));
            this.lblTransNo.Enabled = ((bool)(resources.GetObject("lblTransNo.Enabled")));
            this.lblTransNo.Font = ((System.Drawing.Font)(resources.GetObject("lblTransNo.Font")));
            this.lblTransNo.ForeColor = System.Drawing.Color.Maroon;
            this.lblTransNo.Image = ((System.Drawing.Image)(resources.GetObject("lblTransNo.Image")));
            this.lblTransNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTransNo.ImageAlign")));
            this.lblTransNo.ImageIndex = ((int)(resources.GetObject("lblTransNo.ImageIndex")));
            this.lblTransNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblTransNo.ImeMode")));
            this.lblTransNo.Location = ((System.Drawing.Point)(resources.GetObject("lblTransNo.Location")));
            this.lblTransNo.Name = "lblTransNo";
            this.lblTransNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblTransNo.RightToLeft")));
            this.lblTransNo.Size = ((System.Drawing.Size)(resources.GetObject("lblTransNo.Size")));
            this.lblTransNo.TabIndex = ((int)(resources.GetObject("lblTransNo.TabIndex")));
            this.lblTransNo.Text = resources.GetString("lblTransNo.Text");
            this.lblTransNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblTransNo.TextAlign")));
            this.lblTransNo.Visible = ((bool)(resources.GetObject("lblTransNo.Visible")));
            // 
            // btnTransNo
            // 
            this.btnTransNo.AccessibleDescription = resources.GetString("btnTransNo.AccessibleDescription");
            this.btnTransNo.AccessibleName = resources.GetString("btnTransNo.AccessibleName");
            this.btnTransNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnTransNo.Anchor")));
            this.btnTransNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnTransNo.BackgroundImage")));
            this.btnTransNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnTransNo.Dock")));
            this.btnTransNo.Enabled = ((bool)(resources.GetObject("btnTransNo.Enabled")));
            this.btnTransNo.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnTransNo.FlatStyle")));
            this.btnTransNo.Font = ((System.Drawing.Font)(resources.GetObject("btnTransNo.Font")));
            this.btnTransNo.Image = ((System.Drawing.Image)(resources.GetObject("btnTransNo.Image")));
            this.btnTransNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnTransNo.ImageAlign")));
            this.btnTransNo.ImageIndex = ((int)(resources.GetObject("btnTransNo.ImageIndex")));
            this.btnTransNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnTransNo.ImeMode")));
            this.btnTransNo.Location = ((System.Drawing.Point)(resources.GetObject("btnTransNo.Location")));
            this.btnTransNo.Name = "btnTransNo";
            this.btnTransNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnTransNo.RightToLeft")));
            this.btnTransNo.Size = ((System.Drawing.Size)(resources.GetObject("btnTransNo.Size")));
            this.btnTransNo.TabIndex = ((int)(resources.GetObject("btnTransNo.TabIndex")));
            this.btnTransNo.Text = resources.GetString("btnTransNo.Text");
            this.btnTransNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnTransNo.TextAlign")));
            this.btnTransNo.Visible = ((bool)(resources.GetObject("btnTransNo.Visible")));
            this.btnTransNo.Click += new System.EventHandler(this.btnTransNo_Click);
            // 
            // txtFGoodsCode
            // 
            this.txtFGoodsCode.AccessibleDescription = resources.GetString("txtFGoodsCode.AccessibleDescription");
            this.txtFGoodsCode.AccessibleName = resources.GetString("txtFGoodsCode.AccessibleName");
            this.txtFGoodsCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtFGoodsCode.Anchor")));
            this.txtFGoodsCode.AutoSize = ((bool)(resources.GetObject("txtFGoodsCode.AutoSize")));
            this.txtFGoodsCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtFGoodsCode.BackgroundImage")));
            this.txtFGoodsCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtFGoodsCode.Dock")));
            this.txtFGoodsCode.Enabled = ((bool)(resources.GetObject("txtFGoodsCode.Enabled")));
            this.txtFGoodsCode.Font = ((System.Drawing.Font)(resources.GetObject("txtFGoodsCode.Font")));
            this.txtFGoodsCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtFGoodsCode.ImeMode")));
            this.txtFGoodsCode.Location = ((System.Drawing.Point)(resources.GetObject("txtFGoodsCode.Location")));
            this.txtFGoodsCode.MaxLength = ((int)(resources.GetObject("txtFGoodsCode.MaxLength")));
            this.txtFGoodsCode.Multiline = ((bool)(resources.GetObject("txtFGoodsCode.Multiline")));
            this.txtFGoodsCode.Name = "txtFGoodsCode";
            this.txtFGoodsCode.PasswordChar = ((char)(resources.GetObject("txtFGoodsCode.PasswordChar")));
            this.txtFGoodsCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtFGoodsCode.RightToLeft")));
            this.txtFGoodsCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtFGoodsCode.ScrollBars")));
            this.txtFGoodsCode.Size = ((System.Drawing.Size)(resources.GetObject("txtFGoodsCode.Size")));
            this.txtFGoodsCode.TabIndex = ((int)(resources.GetObject("txtFGoodsCode.TabIndex")));
            this.txtFGoodsCode.Tag = "0";
            this.txtFGoodsCode.Text = resources.GetString("txtFGoodsCode.Text");
            this.txtFGoodsCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtFGoodsCode.TextAlign")));
            this.txtFGoodsCode.Visible = ((bool)(resources.GetObject("txtFGoodsCode.Visible")));
            this.txtFGoodsCode.WordWrap = ((bool)(resources.GetObject("txtFGoodsCode.WordWrap")));
            this.txtFGoodsCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFGoodsCode_KeyDown);
            this.txtFGoodsCode.Validating += new System.ComponentModel.CancelEventHandler(this.txtFGoodsCode_Validating);
            // 
            // btnFGoodsCode
            // 
            this.btnFGoodsCode.AccessibleDescription = resources.GetString("btnFGoodsCode.AccessibleDescription");
            this.btnFGoodsCode.AccessibleName = resources.GetString("btnFGoodsCode.AccessibleName");
            this.btnFGoodsCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnFGoodsCode.Anchor")));
            this.btnFGoodsCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnFGoodsCode.BackgroundImage")));
            this.btnFGoodsCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnFGoodsCode.Dock")));
            this.btnFGoodsCode.Enabled = ((bool)(resources.GetObject("btnFGoodsCode.Enabled")));
            this.btnFGoodsCode.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnFGoodsCode.FlatStyle")));
            this.btnFGoodsCode.Font = ((System.Drawing.Font)(resources.GetObject("btnFGoodsCode.Font")));
            this.btnFGoodsCode.Image = ((System.Drawing.Image)(resources.GetObject("btnFGoodsCode.Image")));
            this.btnFGoodsCode.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFGoodsCode.ImageAlign")));
            this.btnFGoodsCode.ImageIndex = ((int)(resources.GetObject("btnFGoodsCode.ImageIndex")));
            this.btnFGoodsCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnFGoodsCode.ImeMode")));
            this.btnFGoodsCode.Location = ((System.Drawing.Point)(resources.GetObject("btnFGoodsCode.Location")));
            this.btnFGoodsCode.Name = "btnFGoodsCode";
            this.btnFGoodsCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnFGoodsCode.RightToLeft")));
            this.btnFGoodsCode.Size = ((System.Drawing.Size)(resources.GetObject("btnFGoodsCode.Size")));
            this.btnFGoodsCode.TabIndex = ((int)(resources.GetObject("btnFGoodsCode.TabIndex")));
            this.btnFGoodsCode.Tag = "0";
            this.btnFGoodsCode.Text = resources.GetString("btnFGoodsCode.Text");
            this.btnFGoodsCode.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnFGoodsCode.TextAlign")));
            this.btnFGoodsCode.Visible = ((bool)(resources.GetObject("btnFGoodsCode.Visible")));
            this.btnFGoodsCode.Click += new System.EventHandler(this.btnFGoodsCode_Click);
            // 
            // lblFGoodsCode
            // 
            this.lblFGoodsCode.AccessibleDescription = resources.GetString("lblFGoodsCode.AccessibleDescription");
            this.lblFGoodsCode.AccessibleName = resources.GetString("lblFGoodsCode.AccessibleName");
            this.lblFGoodsCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblFGoodsCode.Anchor")));
            this.lblFGoodsCode.AutoSize = ((bool)(resources.GetObject("lblFGoodsCode.AutoSize")));
            this.lblFGoodsCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblFGoodsCode.Dock")));
            this.lblFGoodsCode.Enabled = ((bool)(resources.GetObject("lblFGoodsCode.Enabled")));
            this.lblFGoodsCode.Font = ((System.Drawing.Font)(resources.GetObject("lblFGoodsCode.Font")));
            this.lblFGoodsCode.ForeColor = System.Drawing.Color.Maroon;
            this.lblFGoodsCode.Image = ((System.Drawing.Image)(resources.GetObject("lblFGoodsCode.Image")));
            this.lblFGoodsCode.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblFGoodsCode.ImageAlign")));
            this.lblFGoodsCode.ImageIndex = ((int)(resources.GetObject("lblFGoodsCode.ImageIndex")));
            this.lblFGoodsCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblFGoodsCode.ImeMode")));
            this.lblFGoodsCode.Location = ((System.Drawing.Point)(resources.GetObject("lblFGoodsCode.Location")));
            this.lblFGoodsCode.Name = "lblFGoodsCode";
            this.lblFGoodsCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblFGoodsCode.RightToLeft")));
            this.lblFGoodsCode.Size = ((System.Drawing.Size)(resources.GetObject("lblFGoodsCode.Size")));
            this.lblFGoodsCode.TabIndex = ((int)(resources.GetObject("lblFGoodsCode.TabIndex")));
            this.lblFGoodsCode.Tag = "0";
            this.lblFGoodsCode.Text = resources.GetString("lblFGoodsCode.Text");
            this.lblFGoodsCode.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblFGoodsCode.TextAlign")));
            this.lblFGoodsCode.Visible = ((bool)(resources.GetObject("lblFGoodsCode.Visible")));
            // 
            // txtPartName
            // 
            this.txtPartName.AccessibleDescription = resources.GetString("txtPartName.AccessibleDescription");
            this.txtPartName.AccessibleName = resources.GetString("txtPartName.AccessibleName");
            this.txtPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPartName.Anchor")));
            this.txtPartName.AutoSize = ((bool)(resources.GetObject("txtPartName.AutoSize")));
            this.txtPartName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPartName.BackgroundImage")));
            this.txtPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPartName.Dock")));
            this.txtPartName.Enabled = ((bool)(resources.GetObject("txtPartName.Enabled")));
            this.txtPartName.Font = ((System.Drawing.Font)(resources.GetObject("txtPartName.Font")));
            this.txtPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPartName.ImeMode")));
            this.txtPartName.Location = ((System.Drawing.Point)(resources.GetObject("txtPartName.Location")));
            this.txtPartName.MaxLength = ((int)(resources.GetObject("txtPartName.MaxLength")));
            this.txtPartName.Multiline = ((bool)(resources.GetObject("txtPartName.Multiline")));
            this.txtPartName.Name = "txtPartName";
            this.txtPartName.PasswordChar = ((char)(resources.GetObject("txtPartName.PasswordChar")));
            this.txtPartName.ReadOnly = true;
            this.txtPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPartName.RightToLeft")));
            this.txtPartName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPartName.ScrollBars")));
            this.txtPartName.Size = ((System.Drawing.Size)(resources.GetObject("txtPartName.Size")));
            this.txtPartName.TabIndex = ((int)(resources.GetObject("txtPartName.TabIndex")));
            this.txtPartName.Text = resources.GetString("txtPartName.Text");
            this.txtPartName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPartName.TextAlign")));
            this.txtPartName.Visible = ((bool)(resources.GetObject("txtPartName.Visible")));
            this.txtPartName.WordWrap = ((bool)(resources.GetObject("txtPartName.WordWrap")));
            // 
            // lblPartName
            // 
            this.lblPartName.AccessibleDescription = resources.GetString("lblPartName.AccessibleDescription");
            this.lblPartName.AccessibleName = resources.GetString("lblPartName.AccessibleName");
            this.lblPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPartName.Anchor")));
            this.lblPartName.AutoSize = ((bool)(resources.GetObject("lblPartName.AutoSize")));
            this.lblPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPartName.Dock")));
            this.lblPartName.Enabled = ((bool)(resources.GetObject("lblPartName.Enabled")));
            this.lblPartName.Font = ((System.Drawing.Font)(resources.GetObject("lblPartName.Font")));
            this.lblPartName.Image = ((System.Drawing.Image)(resources.GetObject("lblPartName.Image")));
            this.lblPartName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.ImageAlign")));
            this.lblPartName.ImageIndex = ((int)(resources.GetObject("lblPartName.ImageIndex")));
            this.lblPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPartName.ImeMode")));
            this.lblPartName.Location = ((System.Drawing.Point)(resources.GetObject("lblPartName.Location")));
            this.lblPartName.Name = "lblPartName";
            this.lblPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPartName.RightToLeft")));
            this.lblPartName.Size = ((System.Drawing.Size)(resources.GetObject("lblPartName.Size")));
            this.lblPartName.TabIndex = ((int)(resources.GetObject("lblPartName.TabIndex")));
            this.lblPartName.Text = resources.GetString("lblPartName.Text");
            this.lblPartName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPartName.TextAlign")));
            this.lblPartName.Visible = ((bool)(resources.GetObject("lblPartName.Visible")));
            // 
            // txtPurpose
            // 
            this.txtPurpose.AccessibleDescription = resources.GetString("txtPurpose.AccessibleDescription");
            this.txtPurpose.AccessibleName = resources.GetString("txtPurpose.AccessibleName");
            this.txtPurpose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPurpose.Anchor")));
            this.txtPurpose.AutoSize = ((bool)(resources.GetObject("txtPurpose.AutoSize")));
            this.txtPurpose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPurpose.BackgroundImage")));
            this.txtPurpose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPurpose.Dock")));
            this.txtPurpose.Enabled = ((bool)(resources.GetObject("txtPurpose.Enabled")));
            this.txtPurpose.Font = ((System.Drawing.Font)(resources.GetObject("txtPurpose.Font")));
            this.txtPurpose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPurpose.ImeMode")));
            this.txtPurpose.Location = ((System.Drawing.Point)(resources.GetObject("txtPurpose.Location")));
            this.txtPurpose.MaxLength = ((int)(resources.GetObject("txtPurpose.MaxLength")));
            this.txtPurpose.Multiline = ((bool)(resources.GetObject("txtPurpose.Multiline")));
            this.txtPurpose.Name = "txtPurpose";
            this.txtPurpose.PasswordChar = ((char)(resources.GetObject("txtPurpose.PasswordChar")));
            this.txtPurpose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPurpose.RightToLeft")));
            this.txtPurpose.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPurpose.ScrollBars")));
            this.txtPurpose.Size = ((System.Drawing.Size)(resources.GetObject("txtPurpose.Size")));
            this.txtPurpose.TabIndex = ((int)(resources.GetObject("txtPurpose.TabIndex")));
            this.txtPurpose.Text = resources.GetString("txtPurpose.Text");
            this.txtPurpose.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPurpose.TextAlign")));
            this.txtPurpose.Visible = ((bool)(resources.GetObject("txtPurpose.Visible")));
            this.txtPurpose.WordWrap = ((bool)(resources.GetObject("txtPurpose.WordWrap")));
            this.txtPurpose.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPurpose_KeyDown);
            this.txtPurpose.Validating += new System.ComponentModel.CancelEventHandler(this.txtPurpose_Validating);
            // 
            // btnPurpose
            // 
            this.btnPurpose.AccessibleDescription = resources.GetString("btnPurpose.AccessibleDescription");
            this.btnPurpose.AccessibleName = resources.GetString("btnPurpose.AccessibleName");
            this.btnPurpose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPurpose.Anchor")));
            this.btnPurpose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPurpose.BackgroundImage")));
            this.btnPurpose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPurpose.Dock")));
            this.btnPurpose.Enabled = ((bool)(resources.GetObject("btnPurpose.Enabled")));
            this.btnPurpose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPurpose.FlatStyle")));
            this.btnPurpose.Font = ((System.Drawing.Font)(resources.GetObject("btnPurpose.Font")));
            this.btnPurpose.Image = ((System.Drawing.Image)(resources.GetObject("btnPurpose.Image")));
            this.btnPurpose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPurpose.ImageAlign")));
            this.btnPurpose.ImageIndex = ((int)(resources.GetObject("btnPurpose.ImageIndex")));
            this.btnPurpose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPurpose.ImeMode")));
            this.btnPurpose.Location = ((System.Drawing.Point)(resources.GetObject("btnPurpose.Location")));
            this.btnPurpose.Name = "btnPurpose";
            this.btnPurpose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPurpose.RightToLeft")));
            this.btnPurpose.Size = ((System.Drawing.Size)(resources.GetObject("btnPurpose.Size")));
            this.btnPurpose.TabIndex = ((int)(resources.GetObject("btnPurpose.TabIndex")));
            this.btnPurpose.Text = resources.GetString("btnPurpose.Text");
            this.btnPurpose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPurpose.TextAlign")));
            this.btnPurpose.Visible = ((bool)(resources.GetObject("btnPurpose.Visible")));
            this.btnPurpose.Click += new System.EventHandler(this.btnPurpose_Click);
            // 
            // lblPurpose
            // 
            this.lblPurpose.AccessibleDescription = resources.GetString("lblPurpose.AccessibleDescription");
            this.lblPurpose.AccessibleName = resources.GetString("lblPurpose.AccessibleName");
            this.lblPurpose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPurpose.Anchor")));
            this.lblPurpose.AutoSize = ((bool)(resources.GetObject("lblPurpose.AutoSize")));
            this.lblPurpose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPurpose.Dock")));
            this.lblPurpose.Enabled = ((bool)(resources.GetObject("lblPurpose.Enabled")));
            this.lblPurpose.Font = ((System.Drawing.Font)(resources.GetObject("lblPurpose.Font")));
            this.lblPurpose.ForeColor = System.Drawing.Color.Maroon;
            this.lblPurpose.Image = ((System.Drawing.Image)(resources.GetObject("lblPurpose.Image")));
            this.lblPurpose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPurpose.ImageAlign")));
            this.lblPurpose.ImageIndex = ((int)(resources.GetObject("lblPurpose.ImageIndex")));
            this.lblPurpose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPurpose.ImeMode")));
            this.lblPurpose.Location = ((System.Drawing.Point)(resources.GetObject("lblPurpose.Location")));
            this.lblPurpose.Name = "lblPurpose";
            this.lblPurpose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPurpose.RightToLeft")));
            this.lblPurpose.Size = ((System.Drawing.Size)(resources.GetObject("lblPurpose.Size")));
            this.lblPurpose.TabIndex = ((int)(resources.GetObject("lblPurpose.TabIndex")));
            this.lblPurpose.Text = resources.GetString("lblPurpose.Text");
            this.lblPurpose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPurpose.TextAlign")));
            this.lblPurpose.Visible = ((bool)(resources.GetObject("lblPurpose.Visible")));
            // 
            // btnPrint
            // 
            this.btnPrint.AccessibleDescription = resources.GetString("btnPrint.AccessibleDescription");
            this.btnPrint.AccessibleName = resources.GetString("btnPrint.AccessibleName");
            this.btnPrint.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPrint.Anchor")));
            this.btnPrint.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPrint.BackgroundImage")));
            this.btnPrint.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPrint.Dock")));
            this.btnPrint.Enabled = ((bool)(resources.GetObject("btnPrint.Enabled")));
            this.btnPrint.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPrint.FlatStyle")));
            this.btnPrint.Font = ((System.Drawing.Font)(resources.GetObject("btnPrint.Font")));
            this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
            this.btnPrint.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPrint.ImageAlign")));
            this.btnPrint.ImageIndex = ((int)(resources.GetObject("btnPrint.ImageIndex")));
            this.btnPrint.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPrint.ImeMode")));
            this.btnPrint.Location = ((System.Drawing.Point)(resources.GetObject("btnPrint.Location")));
            this.btnPrint.Name = "btnPrint";
            this.btnPrint.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPrint.RightToLeft")));
            this.btnPrint.Size = ((System.Drawing.Size)(resources.GetObject("btnPrint.Size")));
            this.btnPrint.TabIndex = ((int)(resources.GetObject("btnPrint.TabIndex")));
            this.btnPrint.Text = resources.GetString("btnPrint.Text");
            this.btnPrint.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPrint.TextAlign")));
            this.btnPrint.Visible = ((bool)(resources.GetObject("btnPrint.Visible")));
            this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
            // 
            // btnSave
            // 
            this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
            this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
            this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
            this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
            this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
            this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
            this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
            this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
            this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
            this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
            this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
            this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
            this.btnSave.Name = "btnSave";
            this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
            this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
            this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
            this.btnSave.Text = resources.GetString("btnSave.Text");
            this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
            this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // btnAdd
            // 
            this.btnAdd.AccessibleDescription = resources.GetString("btnAdd.AccessibleDescription");
            this.btnAdd.AccessibleName = resources.GetString("btnAdd.AccessibleName");
            this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnAdd.Anchor")));
            this.btnAdd.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnAdd.BackgroundImage")));
            this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnAdd.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnAdd.Dock")));
            this.btnAdd.Enabled = ((bool)(resources.GetObject("btnAdd.Enabled")));
            this.btnAdd.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnAdd.FlatStyle")));
            this.btnAdd.Font = ((System.Drawing.Font)(resources.GetObject("btnAdd.Font")));
            this.btnAdd.Image = ((System.Drawing.Image)(resources.GetObject("btnAdd.Image")));
            this.btnAdd.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.ImageAlign")));
            this.btnAdd.ImageIndex = ((int)(resources.GetObject("btnAdd.ImageIndex")));
            this.btnAdd.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnAdd.ImeMode")));
            this.btnAdd.Location = ((System.Drawing.Point)(resources.GetObject("btnAdd.Location")));
            this.btnAdd.Name = "btnAdd";
            this.btnAdd.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnAdd.RightToLeft")));
            this.btnAdd.Size = ((System.Drawing.Size)(resources.GetObject("btnAdd.Size")));
            this.btnAdd.TabIndex = ((int)(resources.GetObject("btnAdd.TabIndex")));
            this.btnAdd.Text = resources.GetString("btnAdd.Text");
            this.btnAdd.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.TextAlign")));
            this.btnAdd.Visible = ((bool)(resources.GetObject("btnAdd.Visible")));
            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
            // 
            // btnEdit
            // 
            this.btnEdit.AccessibleDescription = resources.GetString("btnEdit.AccessibleDescription");
            this.btnEdit.AccessibleName = resources.GetString("btnEdit.AccessibleName");
            this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnEdit.Anchor")));
            this.btnEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnEdit.BackgroundImage")));
            this.btnEdit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnEdit.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnEdit.Dock")));
            this.btnEdit.Enabled = ((bool)(resources.GetObject("btnEdit.Enabled")));
            this.btnEdit.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnEdit.FlatStyle")));
            this.btnEdit.Font = ((System.Drawing.Font)(resources.GetObject("btnEdit.Font")));
            this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image")));
            this.btnEdit.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.ImageAlign")));
            this.btnEdit.ImageIndex = ((int)(resources.GetObject("btnEdit.ImageIndex")));
            this.btnEdit.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnEdit.ImeMode")));
            this.btnEdit.Location = ((System.Drawing.Point)(resources.GetObject("btnEdit.Location")));
            this.btnEdit.Name = "btnEdit";
            this.btnEdit.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnEdit.RightToLeft")));
            this.btnEdit.Size = ((System.Drawing.Size)(resources.GetObject("btnEdit.Size")));
            this.btnEdit.TabIndex = ((int)(resources.GetObject("btnEdit.TabIndex")));
            this.btnEdit.Text = resources.GetString("btnEdit.Text");
            this.btnEdit.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.TextAlign")));
            this.btnEdit.Visible = ((bool)(resources.GetObject("btnEdit.Visible")));
            this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
            // 
            // btnDelete
            // 
            this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
            this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
            this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
            this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
            this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
            this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
            this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
            this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
            this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
            this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
            this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
            this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
            this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
            this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
            this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
            this.btnDelete.Text = resources.GetString("btnDelete.Text");
            this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
            this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
            this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
            // 
            // txtProductionLine
            // 
            this.txtProductionLine.AccessibleDescription = resources.GetString("txtProductionLine.AccessibleDescription");
            this.txtProductionLine.AccessibleName = resources.GetString("txtProductionLine.AccessibleName");
            this.txtProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtProductionLine.Anchor")));
            this.txtProductionLine.AutoSize = ((bool)(resources.GetObject("txtProductionLine.AutoSize")));
            this.txtProductionLine.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtProductionLine.BackgroundImage")));
            this.txtProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtProductionLine.Dock")));
            this.txtProductionLine.Enabled = ((bool)(resources.GetObject("txtProductionLine.Enabled")));
            this.txtProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("txtProductionLine.Font")));
            this.txtProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtProductionLine.ImeMode")));
            this.txtProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("txtProductionLine.Location")));
            this.txtProductionLine.MaxLength = ((int)(resources.GetObject("txtProductionLine.MaxLength")));
            this.txtProductionLine.Multiline = ((bool)(resources.GetObject("txtProductionLine.Multiline")));
            this.txtProductionLine.Name = "txtProductionLine";
            this.txtProductionLine.PasswordChar = ((char)(resources.GetObject("txtProductionLine.PasswordChar")));
            this.txtProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtProductionLine.RightToLeft")));
            this.txtProductionLine.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtProductionLine.ScrollBars")));
            this.txtProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("txtProductionLine.Size")));
            this.txtProductionLine.TabIndex = ((int)(resources.GetObject("txtProductionLine.TabIndex")));
            this.txtProductionLine.Text = resources.GetString("txtProductionLine.Text");
            this.txtProductionLine.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtProductionLine.TextAlign")));
            this.txtProductionLine.Visible = ((bool)(resources.GetObject("txtProductionLine.Visible")));
            this.txtProductionLine.WordWrap = ((bool)(resources.GetObject("txtProductionLine.WordWrap")));
            this.txtProductionLine.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtProductionLine_KeyDown);
            this.txtProductionLine.Validating += new System.ComponentModel.CancelEventHandler(this.txtProductionLine_Validating);
            // 
            // lblProductionLine
            // 
            this.lblProductionLine.AccessibleDescription = resources.GetString("lblProductionLine.AccessibleDescription");
            this.lblProductionLine.AccessibleName = resources.GetString("lblProductionLine.AccessibleName");
            this.lblProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblProductionLine.Anchor")));
            this.lblProductionLine.AutoSize = ((bool)(resources.GetObject("lblProductionLine.AutoSize")));
            this.lblProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblProductionLine.Dock")));
            this.lblProductionLine.Enabled = ((bool)(resources.GetObject("lblProductionLine.Enabled")));
            this.lblProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("lblProductionLine.Font")));
            this.lblProductionLine.ForeColor = System.Drawing.Color.Maroon;
            this.lblProductionLine.Image = ((System.Drawing.Image)(resources.GetObject("lblProductionLine.Image")));
            this.lblProductionLine.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblProductionLine.ImageAlign")));
            this.lblProductionLine.ImageIndex = ((int)(resources.GetObject("lblProductionLine.ImageIndex")));
            this.lblProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblProductionLine.ImeMode")));
            this.lblProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("lblProductionLine.Location")));
            this.lblProductionLine.Name = "lblProductionLine";
            this.lblProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblProductionLine.RightToLeft")));
            this.lblProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("lblProductionLine.Size")));
            this.lblProductionLine.TabIndex = ((int)(resources.GetObject("lblProductionLine.TabIndex")));
            this.lblProductionLine.Tag = "0";
            this.lblProductionLine.Text = resources.GetString("lblProductionLine.Text");
            this.lblProductionLine.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblProductionLine.TextAlign")));
            this.lblProductionLine.Visible = ((bool)(resources.GetObject("lblProductionLine.Visible")));
            // 
            // btnProductionLine
            // 
            this.btnProductionLine.AccessibleDescription = resources.GetString("btnProductionLine.AccessibleDescription");
            this.btnProductionLine.AccessibleName = resources.GetString("btnProductionLine.AccessibleName");
            this.btnProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnProductionLine.Anchor")));
            this.btnProductionLine.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnProductionLine.BackgroundImage")));
            this.btnProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnProductionLine.Dock")));
            this.btnProductionLine.Enabled = ((bool)(resources.GetObject("btnProductionLine.Enabled")));
            this.btnProductionLine.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnProductionLine.FlatStyle")));
            this.btnProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("btnProductionLine.Font")));
            this.btnProductionLine.Image = ((System.Drawing.Image)(resources.GetObject("btnProductionLine.Image")));
            this.btnProductionLine.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProductionLine.ImageAlign")));
            this.btnProductionLine.ImageIndex = ((int)(resources.GetObject("btnProductionLine.ImageIndex")));
            this.btnProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnProductionLine.ImeMode")));
            this.btnProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("btnProductionLine.Location")));
            this.btnProductionLine.Name = "btnProductionLine";
            this.btnProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnProductionLine.RightToLeft")));
            this.btnProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("btnProductionLine.Size")));
            this.btnProductionLine.TabIndex = ((int)(resources.GetObject("btnProductionLine.TabIndex")));
            this.btnProductionLine.Text = resources.GetString("btnProductionLine.Text");
            this.btnProductionLine.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProductionLine.TextAlign")));
            this.btnProductionLine.Visible = ((bool)(resources.GetObject("btnProductionLine.Visible")));
            this.btnProductionLine.Click += new System.EventHandler(this.btnProductionLine_Click);
            // 
            // chkProduction
            // 
            this.chkProduction.AccessibleDescription = resources.GetString("chkProduction.AccessibleDescription");
            this.chkProduction.AccessibleName = resources.GetString("chkProduction.AccessibleName");
            this.chkProduction.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("chkProduction.Anchor")));
            this.chkProduction.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("chkProduction.Appearance")));
            this.chkProduction.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("chkProduction.BackgroundImage")));
            this.chkProduction.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkProduction.CheckAlign")));
            this.chkProduction.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("chkProduction.Dock")));
            this.chkProduction.Enabled = ((bool)(resources.GetObject("chkProduction.Enabled")));
            this.chkProduction.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("chkProduction.FlatStyle")));
            this.chkProduction.Font = ((System.Drawing.Font)(resources.GetObject("chkProduction.Font")));
            this.chkProduction.Image = ((System.Drawing.Image)(resources.GetObject("chkProduction.Image")));
            this.chkProduction.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkProduction.ImageAlign")));
            this.chkProduction.ImageIndex = ((int)(resources.GetObject("chkProduction.ImageIndex")));
            this.chkProduction.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("chkProduction.ImeMode")));
            this.chkProduction.Location = ((System.Drawing.Point)(resources.GetObject("chkProduction.Location")));
            this.chkProduction.Name = "chkProduction";
            this.chkProduction.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("chkProduction.RightToLeft")));
            this.chkProduction.Size = ((System.Drawing.Size)(resources.GetObject("chkProduction.Size")));
            this.chkProduction.TabIndex = ((int)(resources.GetObject("chkProduction.TabIndex")));
            this.chkProduction.Text = resources.GetString("chkProduction.Text");
            this.chkProduction.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkProduction.TextAlign")));
            this.chkProduction.Visible = ((bool)(resources.GetObject("chkProduction.Visible")));
            // 
            // btnConfirm
            // 
            this.btnConfirm.AccessibleDescription = resources.GetString("btnConfirm.AccessibleDescription");
            this.btnConfirm.AccessibleName = resources.GetString("btnConfirm.AccessibleName");
            this.btnConfirm.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnConfirm.Anchor")));
            this.btnConfirm.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnConfirm.BackgroundImage")));
            this.btnConfirm.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnConfirm.Dock")));
            this.btnConfirm.Enabled = ((bool)(resources.GetObject("btnConfirm.Enabled")));
            this.btnConfirm.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnConfirm.FlatStyle")));
            this.btnConfirm.Font = ((System.Drawing.Font)(resources.GetObject("btnConfirm.Font")));
            this.btnConfirm.Image = ((System.Drawing.Image)(resources.GetObject("btnConfirm.Image")));
            this.btnConfirm.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnConfirm.ImageAlign")));
            this.btnConfirm.ImageIndex = ((int)(resources.GetObject("btnConfirm.ImageIndex")));
            this.btnConfirm.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnConfirm.ImeMode")));
            this.btnConfirm.Location = ((System.Drawing.Point)(resources.GetObject("btnConfirm.Location")));
            this.btnConfirm.Name = "btnConfirm";
            this.btnConfirm.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnConfirm.RightToLeft")));
            this.btnConfirm.Size = ((System.Drawing.Size)(resources.GetObject("btnConfirm.Size")));
            this.btnConfirm.TabIndex = ((int)(resources.GetObject("btnConfirm.TabIndex")));
            this.btnConfirm.Text = resources.GetString("btnConfirm.Text");
            this.btnConfirm.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnConfirm.TextAlign")));
            this.btnConfirm.Visible = ((bool)(resources.GetObject("btnConfirm.Visible")));
            this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
            // 
            // RequiredMaterial
            // 
            this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
            this.AccessibleName = resources.GetString("$this.AccessibleName");
            this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
            this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
            this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
            this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.CancelButton = this.btnClose;
            this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
            this.Controls.Add(this.chkProduction);
            this.Controls.Add(this.txtProductionLine);
            this.Controls.Add(this.txtPurpose);
            this.Controls.Add(this.txtPartName);
            this.Controls.Add(this.txtFGoodsCode);
            this.Controls.Add(this.txtTransNo);
            this.Controls.Add(this.dgrdData);
            this.Controls.Add(this.lblProductionLine);
            this.Controls.Add(this.btnProductionLine);
            this.Controls.Add(this.btnPrint);
            this.Controls.Add(this.btnSave);
            this.Controls.Add(this.btnAdd);
            this.Controls.Add(this.btnPurpose);
            this.Controls.Add(this.lblPurpose);
            this.Controls.Add(this.lblPartName);
            this.Controls.Add(this.btnFGoodsCode);
            this.Controls.Add(this.lblFGoodsCode);
            this.Controls.Add(this.dtmPostDate);
            this.Controls.Add(this.lblPostDate);
            this.Controls.Add(this.lblTransNo);
            this.Controls.Add(this.btnTransNo);
            this.Controls.Add(this.btnSearch);
            this.Controls.Add(this.btnClose);
            this.Controls.Add(this.btnHelp);
            this.Controls.Add(this.btnEdit);
            this.Controls.Add(this.btnDelete);
            this.Controls.Add(this.btnConfirm);
            this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
            this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
            this.KeyPreview = true;
            this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
            this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
            this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
            this.Name = "RequiredMaterial";
            this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
            this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
            this.Text = resources.GetString("$this.Text");
            this.Closing += new System.ComponentModel.CancelEventHandler(this.RequiredMaterial_Closing);
            this.Load += new System.EventHandler(this.SelectWorkOrders_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmPostDate)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion

        #region private methods

        /// <summary>
        /// Clear all data in form
        /// </summary>
        private void ResetForm()
        {
            txtTransNo.Text = string.Empty;
            txtTransNo.Tag = null;
            txtPurpose.Text = string.Empty;
            txtPurpose.Tag = null;
            txtProductionLine.Text = string.Empty;
            txtProductionLine.Tag = null;
            txtFGoodsCode.Text = string.Empty;
            txtFGoodsCode.Tag = null;
            txtPartName.Text = string.Empty;
            txtPartName.Tag = null;
            //clear data in the grid
            if (dstGridData != null && dstGridData.Tables.Count > 0)
                dstGridData.Tables[0].Rows.Clear();
            txtProductionLine.Text = string.Empty;
            txtProductionLine.Tag = null;
            dtmPostDate.Value = DBNull.Value;
            txtTransNo.Focus();
        }
        /// <summary>
        /// Based on FormMode property to switching form mode
        /// case EnumAction.Default:
        /// case EnumAction.Add:
        /// case EnumAction.Edit:
        /// </summary>
        private void SwitchFormMode()
        {
            switch (mFormMode)
            {
                case EnumAction.Default:
                    btnAdd.Enabled = true;
                    btnConfirm.Enabled = dtmPostDate.Enabled = btnEdit.Enabled = btnSave.Enabled = btnDelete.Enabled = dgrdData.AllowDelete = btnPrint.Enabled = false;
                    if (txtTransNo.Text.Trim() != string.Empty)
                        btnEdit.Enabled = btnConfirm.Enabled = btnPrint.Enabled = btnDelete.Enabled = btnEdit.Enabled = true;
                    btnSearch.Enabled = false;
                    btnTransNo.Enabled = true;
                    btnProductionLine.Enabled = false;
                    txtProductionLine.Enabled = false;
                    txtPartName.Enabled = false;
                    btnFGoodsCode.Enabled = false;
                    txtFGoodsCode.Enabled = false;
                    txtPurpose.Enabled = false;
                    btnPurpose.Enabled = false;
                    txtTransNo.Enabled = true;
                    break;
                case EnumAction.Add:
                    btnAdd.Enabled = false;
                    dtmPostDate.Enabled = true;
                    btnSave.Enabled = true;
                    btnEdit.Enabled = false;
                    btnDelete.Enabled = false;
                    dtmPostDate.Focus();
                    dgrdData.AllowDelete = true;
                    btnPrint.Enabled = false;

                    btnSearch.Enabled = true;
                    btnProductionLine.Enabled = true;
                    txtProductionLine.Enabled = true;
                    txtPartName.Enabled = true;
                    btnFGoodsCode.Enabled = true;
                    txtFGoodsCode.Enabled = true;
                    txtPurpose.Enabled = true;
                    btnPurpose.Enabled = true;
                    txtTransNo.Enabled = false;
                    btnTransNo.Enabled = false;
                    break;
                case EnumAction.Edit:
                    btnEdit.Enabled = false;
                    btnAdd.Enabled = false;
                    dtmPostDate.Enabled = true;
                    btnSave.Enabled = true;
                    dtmPostDate.Focus();
                    dgrdData.AllowDelete = true;
                    btnDelete.Enabled = false;
                    btnPrint.Enabled = false;

                    btnSearch.Enabled = true;
                    btnTransNo.Enabled = false;
                    btnProductionLine.Enabled = false;
                    txtProductionLine.Enabled = false;
                    txtPartName.Enabled = false;
                    btnFGoodsCode.Enabled = false;
                    txtFGoodsCode.Enabled = false;
                    txtPurpose.Enabled = false;
                    btnPurpose.Enabled = false;
                    txtTransNo.Enabled = false;
                    break;
            }
        }

        /// <summary>
        /// Config grid layout : lock column, set control to columns...
        /// </summary>
        /// <param name="pblnLock">which specifies that grid's locked or unlocked</param>
        private void ConfigGrid(bool pblnLock)
        {
            dgrdData.Enabled = true;
            for (int i = 0; i < dgrdData.Splits[0].DisplayColumns.Count; i++)
                dgrdData.Splits[0].DisplayColumns[i].Locked = true;
            dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD].Locked = pblnLock;
            dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;

            dgrdData.Splits[0].DisplayColumns[SLDUTRU].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;
            dgrdData.Splits[0].DisplayColumns[WOQTY].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;
            dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.STOCKQUANTITY_FLD].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;
            dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.REQUIREDQUANTITY_FLD].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;
            dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.ACTUALRECEIVED_FLD].DataColumn.NumberFormat = Constants.DECIMAL_LONG_FORMAT;
        }

        private void SetMasterObject()
        {
            voRequireMaterialMaster = new PRO_RequiredMaterialMaster
                                          {
                                              RequiredMaterialMasterID = txtTransNo.Tag != null ? Convert.ToInt32(txtTransNo.Tag) : 0,
                                              IssuePurposeID = (int) txtPurpose.Tag,
                                              ProductionLineID = (int) txtProductionLine.Tag,
                                              SaleOrderDetailID = (int) txtFGoodsCode.Tag,
                                              TransDate = DateTime.Parse(dtmPostDate.Value.ToString()),
                                              Username = SystemProperty.UserName,
                                              TransNo = mFormMode == EnumAction.Edit
                                                            ? txtTransNo.Text
                                                            : new UtilsBO().GetNoForRequirement(txtFGoodsCode.Text, txtProductionLine.Text, Convert.ToDateTime(dtmPostDate.Value))
                                          };

            voRequireMaterialMaster.UserApproval = chkProduction.Checked ? SystemProperty.UserName : string.Empty;
        }

        /// <summary>
        /// Validate all data, and some business rules
        /// </summary>
        /// <returns></returns>
        private bool ValidateData()
        {
            if (FormControlComponents.CheckMandatory(dtmPostDate))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                dtmPostDate.Focus();
                dtmPostDate.Select();
                return false;
            }

            if (FormControlComponents.CheckMandatory(txtPurpose))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                txtPurpose.Focus();
                txtPurpose.Select();
                return false;
            }
            if (FormControlComponents.CheckMandatory(txtProductionLine))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                txtProductionLine.Focus();
                txtProductionLine.Select();
                return false;
            }

            if (FormControlComponents.CheckMandatory(txtFGoodsCode))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                txtFGoodsCode.Focus();
                txtFGoodsCode.Select();
                return false;
            }

            //check row in grid
            int intCountRow = 0;
            for (int i = 0; i < dgrdData.RowCount; i++)
            {
                if (dgrdData[i, BOM_ITEM].ToString() != string.Empty)
                {
                    intCountRow++;
                }
            }
            if (intCountRow == 0)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_CANCELCOMMIT_ATLISTITEMCHECK);
                dgrdData.Row = 0;
                dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[BOM_ITEM]);
                dgrdData.Focus();
                return false;
            }

            //check madatory field in grid
            dgrdData.UpdateData();
            int intRountCount = dgrdData.RowCount;
            for (int i = 0; i < intRountCount; i++)
            {
                if (dgrdData[i, BOM_ITEM].ToString() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Error);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[BOM_ITEM]);
                    dgrdData.Focus();
                    return false;
                }
                if (dgrdData[i, PRO_RequiredMaterialDetailTable.QUANTITY_FLD].ToString() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Error);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                    dgrdData.Focus();
                    return false;
                }
            }

            if (txtPurpose.Tag.Equals((int)PurposeEnum.Plan) && mFormMode == EnumAction.Add)
            {
                ArrayList arrIDs = new ArrayList();
                for (int i = 0; i < intRountCount; i++)
                {
                    string strProductID = dgrdData[i, PRO_RequiredMaterialDetailTable.PRODUCTID_FLD].ToString();
                    if (arrIDs.Contains(strProductID))
                        continue;
                    arrIDs.Add(strProductID);
                    decimal decQuantity = 0;
                    try
                    {
                        decQuantity = Convert.ToDecimal(dgrdData[i, PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                        if (decQuantity < 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_GREATER_THAN, MessageBoxIcon.Warning, new string[] { dgrdData.Columns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD].Caption, "0" });
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                            dgrdData.Focus();
                            return false;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxIcon.Warning);
                        dgrdData.Row = i;
                        dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                        dgrdData.Focus();
                        return false;
                    }
                    decimal decEstimateQty = Convert.ToDecimal(dgrdData[i, SLDUTRU]);
                    decimal decRequiredQty = 0;
                    try
                    {
                        decRequiredQty = Convert.ToDecimal(dgrdData[i, PRO_RequiredMaterialDetailTable.REQUIREDQUANTITY_FLD]);
                    }
                    catch { }
                    if ((decQuantity + decRequiredQty) > decEstimateQty)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_REQUIRED_OVER_QTY, MessageBoxIcon.Warning);
                        dgrdData.Row = i;
                        dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                        dgrdData.Focus();
                        return false;
                    }
                }
            }
            return true;
        }

        /// <summary>
        /// Fill master data based on search result
        /// </summary>
        /// <param name="drwResult">Search Result</param>
        private void FillData(DataRowView drwResult)
        {
            // Fill data to control
            dtmPostDate.Value = drwResult[PRO_RequiredMaterialMasterTable.TRANSDATE_FLD];
            txtTransNo.Text = drwResult[PRO_RequiredMaterialMasterTable.TRANSNO_FLD].ToString();
            txtTransNo.Tag = int.Parse(drwResult[PRO_RequiredMaterialMasterTable.REQUIREMATERIALMASTERID_FLD].ToString());

            txtPurpose.Tag = int.Parse(drwResult[PRO_RequiredMaterialMasterTable.ISSUEPURPOSEID_FLD].ToString());
            txtPurpose.Text = boRequired.GetPurposeCode((int)txtPurpose.Tag);

            txtProductionLine.Tag = int.Parse(drwResult[PRO_RequiredMaterialMasterTable.PRODUCTIONLINEID_FLD].ToString());
            txtProductionLine.Text = boRequired.GetProductionLine((int)txtProductionLine.Tag);

            txtFGoodsCode.Tag = int.Parse(drwResult[PRO_RequiredMaterialMasterTable.SALEORDERDETAILID_FLD].ToString());
            txtFGoodsCode.Text = FormControlComponents.OpenSearchForm(SO_SaleOrderDetailTable.TABLE_NAME, SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD, txtFGoodsCode.Tag.ToString(), null, false)[SO_SaleOrderDetailTable.FGOODSCODE_FLD].ToString();
            DataRow drowProductInfo = boRequired.GetProductInfo((int)txtFGoodsCode.Tag);
            if (drowProductInfo != null)
            {
                txtPartName.Tag = int.Parse(drowProductInfo[ITM_ProductTable.PRODUCTID_FLD].ToString());
                txtPartName.Text = drowProductInfo[ITM_ProductTable.DESCRIPTION_FLD].ToString();
            }
            // Fill data to voRequireMaterialMaster class; 
            voRequireMaterialMaster.IssuePurposeID = (int)txtPurpose.Tag;
            voRequireMaterialMaster.ProductionLineID = (int)txtProductionLine.Tag;
            voRequireMaterialMaster.RequiredMaterialMasterID = (int)txtTransNo.Tag;
            voRequireMaterialMaster.SaleOrderDetailID = (int)txtFGoodsCode.Tag;
            if (drwResult[PRO_RequiredMaterialMasterTable.USERAPPROVAL_FLD] != DBNull.Value
                && drwResult[PRO_RequiredMaterialMasterTable.USERAPPROVAL_FLD].ToString() != string.Empty)
            {
                voRequireMaterialMaster.UserApproval = drwResult[PRO_RequiredMaterialMasterTable.USERAPPROVAL_FLD].ToString();
                chkProduction.Checked = true;
            }
            else
                chkProduction.Checked = false;
            // Fill data to detail control
            dstGridData = boRequired.GetDetailByMaster(voRequireMaterialMaster.RequiredMaterialMasterID);
            // Set Row
            int introw = 1;
            foreach (DataRow drow in dstGridData.Tables[0].Rows)
            {
                drow[PRO_WorkOrderDetailTable.LINE_FLD] = introw;
                introw++;
            }

            dgrdData.DataSource = dstGridData.Tables[0];
            FormControlComponents.RestoreGridLayout(dgrdData, dtStoreGridLayout);
            ConfigGrid(true);
            SwitchFormMode();

            // check if data was used by misc. issue, then user cannot edit this transaction
            bool blnIsReceived = boRequired.IsReceived(voRequireMaterialMaster.RequiredMaterialMasterID);
            if (blnIsReceived)
            {
                btnEdit.Enabled = false;
                btnDelete.Enabled = false;
            }
        }

        private bool SaveData()
        {
            SetMasterObject();
            dgrdData.UpdateData();
            // synchronyze data
            FormControlComponents.SynchronyGridData(dgrdData);
            switch (mFormMode)
            {
                case EnumAction.Add:
                    var newId = boRequired.Insert(voRequireMaterialMaster, dstGridData);
                    txtTransNo.Text = voRequireMaterialMaster.TransNo;
                    txtTransNo.Tag = newId;
                    break;
                case EnumAction.Edit:
                    boRequired.Update(voRequireMaterialMaster, dstGridData);
                    break;
            }

            return true;
        }
        #endregion

        private void SelectWorkOrders_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".SelectWorkOrders_Load()";
            try
            {
                Security objSecurity = new Security();

                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    this.Close();
                    return;
                }

                //store the gridlayout
                dtStoreGridLayout = FormControlComponents.StoreGridLayout(dgrdData);

                //change the form mode
                mFormMode = EnumAction.Default;

                //Format dtmPostDate
                dtmPostDate.FormatType = FormatTypeEnum.CustomFormat;
                dtmPostDate.CustomFormat = Constants.DATETIME_FORMAT_HOUR;

                //clear data
                ResetForm();
                //Diable or Enable buttons
                SwitchFormMode();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        /// <summary>
        /// Display the detail data after searching into the grid
        /// //set layout for the grid
        /// </summary>
        ///
        public void btnSearch_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearch_Click()";
            try
            {
                if (txtProductionLine.Text.Trim() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_SELECT_PRODUCTION_LINE, MessageBoxIcon.Warning);
                    txtProductionLine.Focus();
                    return;
                }
                if (txtFGoodsCode.Text.Trim() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_MATERIALRECEIPT_SELECT_PRODUCT, MessageBoxIcon.Warning);
                    txtFGoodsCode.Focus();
                    return;
                }
                string strTableName = txtPurpose.Tag.Equals((int)PurposeEnum.Plan) ? "v_PRO_RequiredMaterial" : "v_PRO_RequiredMaterialBuHong";
                string strCondition = string.Format("{0}.{1} = {2}", strTableName, PRO_RequiredMaterialMasterTable.PRODUCTIONLINEID_FLD, txtProductionLine.Tag);
                strCondition += string.Format(" AND {0}.{1} = {2}", strTableName, PRO_RequiredMaterialMasterTable.SALEORDERDETAILID_FLD, txtFGoodsCode.Tag);
                DataTable drwResult = FormControlComponents.OpenSearchFormForMultiSelectedRow(strTableName, PRO_RequiredMaterialMasterTable.SALEORDERDETAILID_FLD,
                    txtFGoodsCode.Tag.ToString(), strCondition, true);
                if (drwResult.Rows.Count > 0)
                {
                    // no detail
                    if (dstGridData.Tables.Count == 0 || dstGridData.Tables[0].Rows.Count == 0)
                    {
                        dstGridData.Tables.Clear();
                        dstGridData.Tables.Add(drwResult);
                        dstGridData.Tables[0].TableName = PRO_RequiredMaterialDetailTable.TABLE_NAME;
                        // refine data line and quantity
                        int introw = 1;
                        if (txtPurpose.Tag.Equals((int)PurposeEnum.Plan))
                        {
                            foreach (DataRow drow in dstGridData.Tables[0].Rows)
                            {
                                drow[PRO_WorkOrderDetailTable.LINE_FLD] = introw;
                                introw++;
                            }
                        }
                        else
                        {
                            foreach (DataRow drow in dstGridData.Tables[0].Rows)
                            {
                                drow[PRO_WorkOrderDetailTable.LINE_FLD] = introw;
                                // clear default quantity purpose is not Plan
                                drow[PRO_RequiredMaterialDetailTable.QUANTITY_FLD] = DBNull.Value;
                                introw++;
                            }
                        }
                    }
                    else
                    {
                        foreach (DataRow dNewRow in drwResult.Rows)
                        {
                            strCondition = PRO_RequiredMaterialDetailTable.WORKORDERDETAILID_FLD + "='" + dNewRow[PRO_WorkOrderDetailTable.WORKORDERDETAILID_FLD] + "'";
                            strCondition += " AND " + PRO_RequiredMaterialDetailTable.PRODUCTID_FLD + "='" + dNewRow[ITM_ProductTable.PRODUCTID_FLD] + "'";

                            DataRow[] dCheckRow = dstGridData.Tables[0].Select(strCondition);
                            if (dCheckRow.Length == 0)
                            {
                                DataRow dnew = dstGridData.Tables[0].NewRow();
                                foreach (DataColumn strColumn in dstGridData.Tables[0].Columns)
                                {
                                    if (PRO_RequiredMaterialDetailTable.REQUIREDMATERIALMASTERID_FLD.ToLower() == strColumn.ColumnName.ToLower())
                                        dnew[strColumn.ColumnName] = voRequireMaterialMaster.RequiredMaterialMasterID;
                                    else
                                        dnew[strColumn.ColumnName] = dNewRow[strColumn.ColumnName];
                                }
                                dnew[PRO_WorkOrderDetailTable.LINE_FLD] = dgrdData.RowCount + 1;
                                // clear default quantity purpose is not Plan
                                if (!txtPurpose.Tag.Equals((int)PurposeEnum.Plan))
                                    dnew[PRO_RequiredMaterialDetailTable.QUANTITY_FLD] = DBNull.Value;
                                dstGridData.Tables[0].Rows.Add(dnew);
                            }
                        }
                    }

                    dgrdData.DataSource = dstGridData.Tables[0];
                    FormControlComponents.RestoreGridLayout(dgrdData, dtStoreGridLayout);
                    ConfigGrid(false);
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        /// <summary>
        /// Search for specific WORK Order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.No;
            this.Close();
        }

        private void btnFGoodsCode_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnFGoodsCode_Click()";
            try
            {
                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(v_PRODUCTINFOMATION, SO_SaleOrderDetailTable.FGOODSCODE_FLD, txtFGoodsCode.Text, null, true);
                if (drwResult != null)
                {
                    txtFGoodsCode.Tag = Convert.ToInt32(drwResult[SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD]);
                    txtFGoodsCode.Text = drwResult[SO_SaleOrderDetailTable.FGOODSCODE_FLD].ToString();
                    txtPartName.Text = drwResult[ITM_ProductTable.DESCRIPTION_FLD].ToString();
                    txtPartName.Tag = Convert.ToInt32(drwResult[ITM_ProductTable.PRODUCTID_FLD]);
                    if (dstGridData.Tables.Count > 0)
                        dstGridData.Tables[0].Clear();
                }
                else
                    txtFGoodsCode.Focus();
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void txtFGoodsCode_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtFGoodsCode_Validating()";
            try
            {
                if (!txtFGoodsCode.Modified)
                    return;
                if (txtFGoodsCode.Text.Trim() == string.Empty)
                {
                    txtFGoodsCode.Tag = null;
                    txtPartName.Text = string.Empty;
                    txtPartName.Tag = null;
                    if (dstGridData.Tables.Count > 0)
                        dstGridData.Tables[0].Clear();
                    return;
                }
                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(v_PRODUCTINFOMATION, SO_SaleOrderDetailTable.FGOODSCODE_FLD, txtFGoodsCode.Text, null, false);
                if (drwResult != null)
                {
                    txtFGoodsCode.Tag = Convert.ToInt32(drwResult[SO_SaleOrderDetailTable.SALEORDERDETAILID_FLD]);
                    txtFGoodsCode.Text = drwResult[SO_SaleOrderDetailTable.FGOODSCODE_FLD].ToString();
                    txtPartName.Text = drwResult[ITM_ProductTable.DESCRIPTION_FLD].ToString();
                    txtPartName.Tag = Convert.ToInt32(drwResult[ITM_ProductTable.PRODUCTID_FLD]);
                    if (dstGridData.Tables.Count > 0)
                        dstGridData.Tables[0].Clear();
                }
                else
                    e.Cancel = true;
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void txtFGoodsCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
                btnFGoodsCode_Click(null, null);
        }

        private void btnPurpose_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnPurpose_Click()";
            try
            {
                Hashtable htbCondition = new Hashtable();
                int iIssueMaterialTransID = 0;
                iIssueMaterialTransID = (new UtilsBO()).GetTransTypeIDByCode(TransactionTypeEnum.PROIssueMaterial.ToString());
                htbCondition.Add(MST_TranTypeTable.TRANTYPEID_FLD, iIssueMaterialTransID);

                DataRowView drwResult = null;

                drwResult = FormControlComponents.OpenSearchForm(PRO_IssuePurposeTable.TABLE_NAME, PRO_IssuePurposeTable.DESCRIPTION_FLD, txtPurpose.Text.Trim(), htbCondition, true);
                if (drwResult != null)
                {
                    txtPurpose.Text = drwResult[PRO_IssuePurposeTable.DESCRIPTION_FLD].ToString();
                    txtPurpose.Tag = Convert.ToInt32(drwResult[PRO_IssuePurposeTable.ISSUEPURPOSEID_FLD]);

                    if ((int)PurposeEnum.Plan == (int)txtPurpose.Tag)
                        chkProduction.Checked = true;
                    else
                        chkProduction.Checked = false;

                    if (txtPurpose.Text.Trim() != drwResult[PRO_IssuePurposeTable.DESCRIPTION_FLD].ToString().Trim()
                        && txtPurpose.Text.Trim() != string.Empty)
                    {
                        if (dstGridData != null && dstGridData.Tables.Count > 0)
                            dstGridData.Tables[0].Rows.Clear();
                    }
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }

            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void txtPurpose_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtPurpose_Validating()";
            try
            {
                if (!txtPurpose.Modified)
                    return;
                if (txtPurpose.Text.Trim() == string.Empty)
                {
                    txtPurpose.Tag = null;
                    txtProductionLine.Text = string.Empty;
                    txtProductionLine.Tag = null;
                    txtFGoodsCode.Text = string.Empty;
                    txtFGoodsCode.Tag = null;
                    txtPartName.Text = string.Empty;
                    txtPartName.Tag = null;
                    if (dstGridData != null && dstGridData.Tables.Count > 0)
                        dstGridData.Tables[0].Rows.Clear();
                }
                Hashtable htbCondition = new Hashtable();
                int iIssueMaterialTransID = 0;
                iIssueMaterialTransID = (new UtilsBO()).GetTransTypeIDByCode(TransactionTypeEnum.PROIssueMaterial.ToString());
                htbCondition.Add(MST_TranTypeTable.TRANTYPEID_FLD, iIssueMaterialTransID);

                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(PRO_IssuePurposeTable.TABLE_NAME, PRO_IssuePurposeTable.DESCRIPTION_FLD, txtPurpose.Text.Trim(), htbCondition, false);
                if (drwResult != null)
                {
                    txtPurpose.Text = drwResult[PRO_IssuePurposeTable.DESCRIPTION_FLD].ToString();
                    txtPurpose.Tag = int.Parse(drwResult[PRO_IssuePurposeTable.ISSUEPURPOSEID_FLD].ToString());

                    if ((int)PurposeEnum.Plan == (int)txtPurpose.Tag)
                        chkProduction.Checked = true;
                    else
                        chkProduction.Checked = false;

                    if (txtPurpose.Text.Trim() != drwResult[PRO_IssuePurposeTable.DESCRIPTION_FLD].ToString().Trim())
                    {
                        if (dstGridData != null && dstGridData.Tables.Count > 0)
                            dstGridData.Tables[0].Rows.Clear();
                    }
                }
                else
                    e.Cancel = true;
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }

            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void txtPurpose_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
                btnPurpose_Click(null, null);
        }

        private void btnProductionLine_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnProductionLine_Click()";
            try
            {
                DataRowView drwResult = FormControlComponents.OpenSearchForm(PRO_ProductionLineTable.TABLE_NAME, PRO_ProductionLineTable.CODE_FLD, txtProductionLine.Text.Trim(), null, true);

                if (drwResult != null)
                {
                    txtProductionLine.Text = drwResult[PRO_ProductionLineTable.CODE_FLD].ToString();
                    txtProductionLine.Tag = int.Parse(drwResult[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString());

                    if (txtProductionLine.Text.Trim() != drwResult[PRO_ProductionLineTable.CODE_FLD].ToString().Trim()
                        && txtProductionLine.Text.Trim() != string.Empty)
                    {
                        if (dstGridData != null && dstGridData.Tables.Count > 0)
                            dstGridData.Tables[0].Rows.Clear();
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void txtProductionLine_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnProductionLine_Click()";
            try
            {
                if (!txtProductionLine.Modified)
                    return;
                if (txtProductionLine.Text.Trim() == string.Empty)
                {
                    txtProductionLine.Tag = null;
                    txtFGoodsCode.Text = string.Empty;
                    txtFGoodsCode.Tag = null;
                    txtPartName.Text = string.Empty;
                    txtPartName.Tag = null;
                    if (dstGridData != null && dstGridData.Tables.Count > 0)
                        dstGridData.Tables[0].Rows.Clear();
                }
                DataRowView drwResult = FormControlComponents.OpenSearchForm(PRO_ProductionLineTable.TABLE_NAME, PRO_ProductionLineTable.CODE_FLD, txtProductionLine.Text.Trim(), null, false);

                if (drwResult != null)
                {
                    txtProductionLine.Text = drwResult[PRO_ProductionLineTable.CODE_FLD].ToString();
                    txtProductionLine.Tag = int.Parse(drwResult[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString());
                    if (txtProductionLine.Text.Trim() != drwResult[PRO_ProductionLineTable.CODE_FLD].ToString().Trim()
                        && txtProductionLine.Text.Trim() != string.Empty)
                    {
                        if (dstGridData != null && dstGridData.Tables.Count > 0)
                            dstGridData.Tables[0].Rows.Clear();
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void txtProductionLine_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
                btnProductionLine_Click(null, null);
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnAdd_Click()";
            try
            {
                mFormMode = EnumAction.Add;
                ResetForm();
                SwitchFormMode();
                dtmPostDate.Value = new UtilsBO().GetDBDate();
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSave_Click()";
            try
            {
                if (ValidateData())
                {
                    if (SaveData())
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
                        mFormMode = EnumAction.Default;

                        txtTransNo.Tag = voRequireMaterialMaster.RequiredMaterialMasterID;

                        // Fill data to detail control
                        dstGridData = boRequired.GetDetailByMaster(voRequireMaterialMaster.RequiredMaterialMasterID);
                        // Set Row
                        int introw = 1;
                        foreach (DataRow drow in dstGridData.Tables[0].Rows)
                        {
                            drow[PRO_WorkOrderDetailTable.LINE_FLD] = introw;
                            introw++;
                        }

                        dgrdData.DataSource = dstGridData.Tables[0];
                        FormControlComponents.RestoreGridLayout(dgrdData, dtStoreGridLayout);

                        SwitchFormMode();
                        ConfigGrid(true);
                    }
                    else
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_SAVE_TO_DB, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                if (ex.mCode == ErrorCode.DUPLICATE_KEY)
                    txtTransNo.Focus();
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDelete_Click()";
            try
            {
                if (Security.NoRightToDeleteTransaction(this, PRO_RequiredMaterialMasterTable.REQUIREMATERIALMASTERID_FLD, voRequireMaterialMaster.RequiredMaterialMasterID))
                    return;
                if (boRequired.CheckRequiredDetail((int)txtTransNo.Tag))
                {
                    //allow delete
                    if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        if (boRequired.DeleteRequireMaterial(voRequireMaterialMaster.RequiredMaterialMasterID))
                        {
                            mFormMode = EnumAction.Default;

                            ResetForm();
                            SwitchFormMode();
                        }
                        else PCSMessageBox.Show(ErrorCode.MESSAGE_CAN_NOT_DELETE, MessageBoxIcon.Error);

                    }
                }
                else
                    PCSMessageBox.Show(ErrorCode.CASCADE_DELETE_PREVENT, MessageBoxIcon.Warning);
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void dgrdData_KeyDown(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_KeyDown()";
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.Delete:
                        if ((e.KeyCode == Keys.Delete) && (dgrdData.SelectedRows.Count > 1))
                        {
                            if (mFormMode == EnumAction.Edit)
                            {
                                bool blnAllowDelete = true;
                                int intRowCount = dgrdData.SelectedRows.Count;
                                for (int i = 0; i < intRowCount; i++)
                                {
                                    try
                                    {
                                        if (Convert.ToDecimal(dgrdData[dgrdData.SelectedRows[i], PRO_RequiredMaterialDetailTable.ACTUALRECEIVED_FLD]) > 0)
                                        {
                                            blnAllowDelete = false;
                                            break;
                                        }
                                    }
                                    catch { }
                                }
                                if (blnAllowDelete)
                                {
                                    FormControlComponents.DeleteMultiRowsOnTrueDBGrid(dgrdData);
                                    if (dgrdData.RowCount == 0)
                                        btnDelete_Click(null, null);
                                }
                            }
                            else if (mFormMode == EnumAction.Add)
                                FormControlComponents.DeleteMultiRowsOnTrueDBGrid(dgrdData);

                            // refine the line number
                            for (int i = 0; i < dgrdData.RowCount; i++)
                                dgrdData[i, PRO_WorkOrderDetailTable.LINE_FLD] = i + 1;
                        }
                        break;
                }
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnAdd_Click()";
            try
            {
                mFormMode = EnumAction.Edit;
                SwitchFormMode();
                ConfigGrid(true);
                dgrdData.Splits[0].DisplayColumns[PRO_RequiredMaterialDetailTable.QUANTITY_FLD].Locked = false;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void txtTransNo_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".txtTransNo_Validating()";
            try
            {
                if (!txtTransNo.Modified)
                    return;
                if (txtTransNo.Text.Trim() == string.Empty)
                {
                    // clear data
                    ResetForm();
                    return;
                }
                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(PRO_RequiredMaterialMasterTable.TABLE_NAME, PRO_RequiredMaterialMasterTable.TRANSNO_FLD, txtTransNo.Text, null, false);
                if (drwResult != null)
                    FillData(drwResult);
                else
                    e.Cancel = true;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void txtTransNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F4)
                btnTransNo_Click(null, null);
        }
        private void btnTransNo_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnTransNo_Click()";
            try
            {
                DataRowView drwResult = null;
                drwResult = FormControlComponents.OpenSearchForm(PRO_RequiredMaterialMasterTable.TABLE_NAME, PRO_RequiredMaterialMasterTable.TRANSNO_FLD, txtTransNo.Text, null, true);
                if (drwResult != null)
                    FillData(drwResult);
                else
                    txtTransNo.Focus();
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnPrint_Click()";
            try
            {
                //Change cursor to wait status
                this.Cursor = Cursors.WaitCursor;
                const string REPORT_LAYOUT_FILE = "PhieuYeuCauLinhVatTu_VN.xml";
                const string MASTER_REPORT_NAME = "PhieuYeuCauLinhVatTu";
                const string APPLICATION_PATH = @"PCSMain\bin\Debug";
                const string REPORTFLD_TITLE = "fldTitle";

                //return if no record was selected
                if (txtTransNo.Tag == null)
                    return;

                int intMasterID;

                intMasterID = int.Parse(txtTransNo.Tag.ToString());
                if (intMasterID <= 0)
                    return;

                C1PrintPreviewDialog printPreview = new C1PrintPreviewDialog();

                DataTable dtbResult = boRequired.GetSlipData(voRequireMaterialMaster.RequiredMaterialMasterID);
                ReportWithSubReportBuilder reportBuilder = new ReportWithSubReportBuilder();

                #region Get Actual Report Path
                //Get actual application path
                string strReportPath = Application.StartupPath;
                int intIndex = strReportPath.IndexOf(APPLICATION_PATH);
                if (intIndex > -1)
                    strReportPath = strReportPath.Substring(0, intIndex);

                if (strReportPath.Substring(strReportPath.Length - 1) == @"\")
                    strReportPath += Constants.REPORT_DEFINITION_STORE_LOCATION;
                else
                    strReportPath += "\\" + Constants.REPORT_DEFINITION_STORE_LOCATION;
                #endregion

                #region Get Data Source & Assign To Report
                // Check data source
                if (dtbResult != null)
                {
                    //Set datasource and lay-out path for reports
                    reportBuilder.ReportName = MASTER_REPORT_NAME;
                    reportBuilder.SourceDataTable = dtbResult;

                    reportBuilder.ReportLayoutFile = REPORT_LAYOUT_FILE;
                    reportBuilder.ReportDefinitionFolder = strReportPath;

                    //check if layout is valid
                    if (reportBuilder.AnalyseLayoutFile())
                        reportBuilder.UseLayoutFile = true;
                    else
                    {
                        //Set cursor to default
                        this.Cursor = Cursors.Default;
                        PCSMessageBox.Show(ErrorCode.MESSAGE_REPORT_TEMPLATE_FILE_NOT_FOUND, MessageBoxIcon.Error);
                        return;
                    }

                    reportBuilder.MakeDataTableForRender();

                    // and show it in preview dialog
                    reportBuilder.ReportViewer = printPreview.ReportViewer;
                    reportBuilder.RenderReport();

                    reportBuilder.RefreshReport();

                    //Print report
                    try
                    {
                        printPreview.FormTitle = reportBuilder.GetFieldByName(REPORTFLD_TITLE).Text;
                    }
                    catch
                    { }

                    printPreview.Show();
                }

                #endregion
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            finally
            {
                //Set cursor to default status
                this.Cursor = Cursors.Default;
            }
        }

        private void btnConfirm_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnConfirm_Click()";
            try
            {
                if (FormControlComponents.CheckMandatory(txtTransNo))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
                    txtTransNo.Focus();
                    txtTransNo.Select();
                    return;
                }
                string strUserApproval = chkProduction.Checked ? string.Empty : SystemProperty.UserName;
                if (boRequired.ConfirmProduction(strUserApproval, Convert.ToInt32(txtTransNo.Tag)))
                    PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
                else
                    PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_SAVE_TO_DB, MessageBoxIcon.Warning);
                chkProduction.Checked = strUserApproval == string.Empty ? false : true;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }


        private void dgrdData_AfterColUpdate(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";

            try
            {
                if (e.Column.DataColumn.DataField == PRO_RequiredMaterialDetailTable.QUANTITY_FLD)
                {
                    // get Rate of component
                    decimal decRate = 1;
                    try
                    {
                        decRate = Convert.ToDecimal(dgrdData[dgrdData.Row, ITM_ProductTable.RATE_FLD]);
                    }
                    catch { }
                    decimal decQuantity = Convert.ToDecimal(dgrdData[dgrdData.Row, PRO_RequiredMaterialDetailTable.QUANTITY_FLD]);
                    dgrdData[dgrdData.Row, PRO_RequiredMaterialDetailTable.STOCKQUANTITY_FLD] = decQuantity * decRate;
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_BeforeColUpdate(object sender, BeforeColUpdateEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColUpdate()";

            try
            {
                // check quantity when required as plan
                if (e.Column.DataColumn.DataField == PRO_RequiredMaterialDetailTable.QUANTITY_FLD &&
                    txtPurpose.Tag.Equals((int)PurposeEnum.Plan))
                {
                    decimal decQuantity = 0;
                    try
                    {
                        decQuantity = Convert.ToDecimal(e.Column.DataColumn.Value);
                        if (decQuantity <= 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_GREATER_THAN, MessageBoxIcon.Warning, new string[] { e.Column.DataColumn.Caption, "0" });
                            e.Cancel = true;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxIcon.Warning);
                        e.Cancel = true;
                    }
                    decimal decEstimateQty = Convert.ToDecimal(dgrdData[dgrdData.Row, SLDUTRU]);
                    decimal decRequiredQty = 0;
                    try
                    {
                        decRequiredQty = Convert.ToDecimal(dgrdData[dgrdData.Row, PRO_RequiredMaterialDetailTable.REQUIREDQUANTITY_FLD]);
                    }
                    catch { }
                    if ((decQuantity + decRequiredQty) > decEstimateQty)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_REQUIRED_OVER_QTY, MessageBoxIcon.Warning);
                        e.Cancel = true;
                    }
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
        }

        private void RequiredMaterial_Closing(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".RequiredMaterial_Closing()";
            try
            {
                if (mFormMode != EnumAction.Default)
                {
                    // ask user to save change
                    DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    switch (dlgResult)
                    {
                        case DialogResult.Yes:
                            try
                            {
                                if (!ValidateData())
                                {
                                    e.Cancel = true;
                                    break;
                                }
                                if (!SaveData())
                                    e.Cancel = true;
                            }
                            catch
                            {
                                e.Cancel = true;
                            }
                            break;
                        case DialogResult.No:
                            e.Cancel = false;
                            break;
                        case DialogResult.Cancel:
                            e.Cancel = true;
                            break;
                    }
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_BeforeDelete(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeDelete()";
            try
            {
                if (mFormMode == EnumAction.Edit)
                {
                    try
                    {
                        if (Convert.ToDecimal(dgrdData[dgrdData.Row, PRO_RequiredMaterialDetailTable.ACTUALRECEIVED_FLD]) > 0)
                            e.Cancel = true;
                    }
                    catch { }
                }
                // refine the line number
                for (int i = 0; i < dgrdData.RowCount; i++)
                    dgrdData[i, PRO_WorkOrderDetailTable.LINE_FLD] = i + 1;
            }
            catch (PCSException ex)
            {
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
            catch (Exception ex)
            {
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
                }
            }
        }
    }
}
